package com.example.christina.tools;

/*
        alipay.appId=2018011503899539
        alipay.publicKey=MIIBIjANBgkqhkiG92133EFAAOCAQ8AMIIBCgKCAQEAlDGp9uLXtdaxXeH0jAQ3KuWzAK9wtvURoHNRUz41m9IbVm+mqx0v/9YRvXTZtRAPwB46K4cnJj3vXm5ugPO8VyShw30cJHtZiL1H1pW297Rqm+n7owgkjL8V1ylIKR9GxTe3hhQ4oPOk8JWYdUEMHItd3RUUQ4bnTxAAjqo8R1LyKnhTNQ4BwCoe3tXWntnEXSK32323iINA4yyTXNuk5Qv515fpjjfNUyslnMKW/q329guF8TzBKRe/i/OvPDeYIe7wxdbSNqAFYxd4hNyIjoPnq12cVpeYT1215Bjtj+UBuwsQV//322IDAQAB
        alipay.privateKey=MIIE212BADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCUMan24te11rFd4fSMBDcq5bMAr3C29RGgc1FTPjWb0htWb6arHS//1hG9dNm1EA/AHjorhycmPe9ebm6A87xXJKHDfRwke1mIvUfWlbb3tGqb6fujCCSMvxXXKUgpH0bFN7eGFDig86TwlZh1QQwci13dFRRDhudPEACOqjxHUvIqeFM1DgHAKh7e1dae2cRdIqlgtCdDvJ435456TlC/nXl+mON81TKyWcwpb+q2eFZoWGoD2C4XxPMEpF7+L8688N5gh7vD3245hPjfOPy/H8rkGO2P5QG7CxBX/8Np0fAgMBAAECggEAE6E0e1B29E449k+c3gMc76C3gkq66nEx4YgE6LrfzQEav+tQL3BRUFkhxm+4+sPi4jbey68+X1Fq6J5GIuymMQDYMJXc6XQxWux/nIv+TXdne7mVrHXC43678D6Y0+CtJ+ML1Prb8iCKWvGYF95Oj7LZBpmm6fMR2PJhghIhROkrIFJngewerwfIeaJFRxW/rmzfg1V5N2F3+WRnStu7nD0KOz7S7PZjieymA/Blgrewgerg78ENVMXp2BmZuu3mPOyiiGMBz5pgwree9s9y9Y1/7aZ5SXIQgrewregyNeAP6KXohsPFyulqNN+bpxrVxSjFq2EXYq1tyhr/LVZ13ab4vzFTq4z4x87QfNlar34fw/Fo9acUL41ivSPwl6r4xoXgbQ462TIxCRCXhS7OJYtCx1CKcQKBgQCzXCWH0mc/sD1TQHNKDCvNfZGgSQnBferfrCK10klFx6W98uqKv3+j6DLzlL+iyyx4Fnpsd22PE0U0NNTI0l2lYIOdTCoKeZ3/7w7KJqP3sbHsZnr+vRzR+eOreKjZuaHIjwKBgQCfOQCRv7Qg
        alipay.notifyUrl=http://api.woliegequ.com/api/payment/alipay/notify
*/

//真实可用代码

///*
// /**
//     * 返回支付宝订单ID
//     *
//     * @param oid    订单号
//     * @param price
//     * @param body   备注信息
//     * @param subject 备注信息
//     * @return
//     * @throws ActionParameterException   参数异常
//     */
//public String createOrder(String oid, BigDecimal price, String subject, String body) throws ActionParameterException {
//
//        //实例化客户端
//        AlipayClient alipayClient = new DefaultAlipayClient(
//        "https://openapi.alipay.com/gateway.do",
//        APP_ID,
//        APP_PRIVATE_KEY,
//        "json",
//        "utf-8",
//        ALIPAY_PUBLIC_KEY,
//        "RSA2");
////实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称：alipay.trade.app.pay
//        AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
////SDK已经封装掉了公共参数，这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
//        AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
//        model.setBody(body);
//        model.setSubject(subject);
//        model.setOutTradeNo(oid);
//        model.setTimeoutExpress(TIMEOUT_EXPRESS);
////        model.setTotalAmount("" + price.doubleValue());
//        model.setTotalAmount("0.01");  // 测试环境，设定为 1 分钱
//        model.setProductCode("QUICK_MSECURITY_PAY");
//        request.setBizModel(model);
//        request.setNotifyUrl(NOTIFY_URL);
//
//        try {
//        //这里和普通的接口调用不同，使用的是sdkExecute
//        AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
//        System.out.println(response.getBody());//就是orderString 可以直接给客户端请求，无需再做处理。
//        return response.getBody();
//        } catch (AlipayApiException e) {
//        e.printStackTrace();
//        }
//        return null;
//        }
//
// */
//import java.math.BigDecimal;

import com.example.christina.enity.Goods;

public class ZhiFuBao {
    public static String pay(Goods goods)
    {
        return "支付宝支付："+goods.getPrice().toString();
    }
}
